//
//  ViewController.m
//  28-AutoLayoutAnimation
//
//  Created by 王道林 on 16/8/22.
//  Copyright © 2016年 王道林. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *conter_y;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *layout20;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *layout150;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}


- (IBAction)button:(UIButton *)sender {
#if 0
    // 改变center_y的constaint
    self.conter_y.constant = -200;
    // 执行动画
    [UIView animateWithDuration:5 animations:^{
        [self.view layoutIfNeeded];
    }];
#endif
    // 约束的优先级, 改变时, 需要注意不能为1000, 程序会崩溃
    // 统一约束优先级高德会被执行. 优先级的会被忽略.
    self.layout20.priority = 751;
    self.layout150.priority = 750;
    [UIView animateWithDuration:5 animations:^{
        [self.view layoutIfNeeded];
    }];
    
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
